<template>
	 <el-form ref="form" :model="form">
		  <el-form-item prop="min">
		   	<el-input-number v-model="form.min" @change="handleChange" />
		  </el-form-item>
		  	~
		  <el-form-item prop="max">
		   	<el-input-number v-model="form.max" @change="handleChange" />
		  </el-form-item>
	 </el-form>
</template>
  
<script>  
export default {
 data() {
  return {
    form: { 
      min: null, 
      max: null
    },
  }
 },
 methods: {
		handleChange() {
			let numArray = []
			if(this.form.min===this.form.max){
				if(this.form.min!=0){
					numArray = [this.form.min,this.form.max]
				}
			}else{
				numArray = [this.form.min,this.form.max]
			}
			this.$emit('numberRange',numArray)
	  },
		// 重置置空
		handleReset(){
			this.$set(this.form,'min',null)
			this.$set(this.form,'max',null)
		}
	}
};
</script>